/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.services.manage.question.dao.impl;

import java.util.List;

import shop.core.common.dao.BaseDao;
import shop.core.common.dao.page.PagerModel;
import shop.services.manage.question.bean.Question;
import shop.services.manage.question.dao.QuestionDao;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @类名称：QuestionDaoImpl
 * @创建人：wzl
 * @创建时间：2018-05-09 下午19:24:51  
 * @版本号：1.0
 * @描述：
 */
@Repository("questionDaoManage")
public class QuestionDaoImpl  implements QuestionDao {

    @Resource
    private BaseDao dao;

    public void setDao(BaseDao dao) {
        this.dao = dao;
    }

    public PagerModel selectPageList(Question e) {
        return dao.selectPageList("manage.question.selectPageList","manage.question.selectPageCount", e);
    }

    public List selectList(Question e) {
        return dao.selectList("manage.question.selectList", e);
    }

    public Question selectOne(Question e) {
        return (Question) dao.selectOne("manage.question.selectOne", e);
    }

    public int delete(Question e) {
        return dao.delete("manage.question.delete", e);
    }

    public int update(Question e) {
        return dao.update("manage.question.update", e);
    }

    public int deletes(String[] ids) {
        Question e = new Question();
        for (int i = 0; i < ids.length; i++) {
            e.setId(ids[i]);
            delete(e);
        }
        return 0;
    }

    public int insert(Question e) {
        return dao.insert("manage.question.insert", e);
    }

    public int deleteById(int id) {
        return dao.delete("manage.question.deleteById", id);
    }

    @Override
    public Question selectById(String id) {
        return (Question) dao.selectOne("manage.question.selectById", id);
    }

}

